<template>
	<view>
		<view class="flex align-center justify-between" style="width: 100%;">
			<view class="" style="width: 750rpx;" @click="toDiscuss">
				<uni-list :border="false">
				  <uni-list-item link rightText="查看全部">
						<view class="" slot="header">
							<text class="u-font-30" >宝贝评价({{evaluation.total}})</text>
						</view>
					</uni-list-item>
				</uni-list>
			</view>
		</view>
		<view class="u-p-x-30" v-if="evaluation.info" >
			<view class="flex align-center">
				<image v-if="evaluation.info.avatar" :src="$_BASE_IMG_API + evaluation.info.avatar" style="width: 80rpx;height: 80rpx;border-radius: 40rpx;" mode=""></image>
				<image v-else src="/static/mine/detail-1.png" style="width: 80rpx;height: 80rpx;" mode=""></image>
			  <view class="flex flex-column u-m-l-20">
			    <text class="u-font-26 u-m-b-10" >{{evaluation.info.nickname || '匿名用户xxx'}}</text>
			    <text class="u-font-24 text-greey">{{evaluation.info.createtime}}</text>
			  </view>
			</view>
			<text class="flex u-m-y-20 u-font-24 text-ellipsis-2">{{evaluation.info.content}}</text>
			<view class="flex flex-wrap" v-if="evaluation.info.images">
				<block v-for="(item1,indey) in evaluation.info.images.split(',')" :key="indey">
					<image class="u-m-r-16 u-m-b-10 border" :src="$_BASE_IMG_API + item1" style="width: 110rpx;height: 110rpx; border-radius: 55rpx;" mode=""></image>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "goods-detail-discuss",
		props: {
			goodsId: {
				type: [String, Number],
				default() {
					return ''
				}
			},
			evaluation: {
				type: Object,
				default() {
					return {}
				}
			}
		},
		data() {
			return {
			}
		},
		methods: {
			toDiscuss() {
				uni.navigateTo({
					url: '/pages/goodsDetail/goodsDiscuss/goodsDiscuss?itemId=' +this.goodsId
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.botder-top {
		border-top: 0.5px solid #f6f7f9;
	}
	.uni-list-item__container {
		padding: 0 !important;
	}
</style>
